<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>My JSP 'searchBetweenTwoCity.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<div>
			<div>
				<form action="between2CitiesSearch.do" method="post">
					<table>
						<tr>
							<td>
								出发城市：
							</td>
							<td>
								<input type="text" name="departureCity" />
							</td>
						</tr>
						<tr>
							<td>
								到达城市：
							</td>
							<td>
								<input type="text" name="destinationCity" />
							</td>
						</tr>
						<tr>
							<td>
								<input type="submit" value="搜索" />
							</td>
							<td>
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div>
				<c:if test="${informations != null}">
					<div>
					<table>
						<tr>
							<td>
								出发城市
							</td>
							<td>
								目的地城市
							</td>
							<td>
								出发时间
							</td>
							<td>
								发布时间
							</td>
						</tr>
						<c:forEach items="${informations.object}" var="information">
							<tr>
								<td>
									<c:forEach items="${information.addresses}" var="address">
										<c:if test="${address.type eq '01'}">
											<c:out value="${address.province}"/>
											<c:out value="${address.city}"/>
										</c:if>
									</c:forEach>
								</td>
								<td>
									<c:forEach items="${information.addresses}" var="address">
										<c:if test="${address.type eq '03'}">
											<c:out value="${address.province}"/>
											<c:out value="${address.city}"/>
										</c:if>
									</c:forEach>
								</td>
								<td>
									<fmt:formatDate value="${information.departureTime }" type="both" pattern="EEEE, MMMM d, yyyy HH:mm Z"/>
								</td>
								<td>
									<fmt:formatDate value="${information.createTime }" type="both" pattern="EEEE, MMMM d, yyyy HH:mm Z"/>
								</td>
								<td>
									<a
										href="detailInformation.do?informationID=${information.informationId}">详细信息</a>
								</td>
							</tr>
						</c:forEach>
					</table>
					</div>
					<div>
				<pg:pager url="between2CitiesSearch.do" items="${informations.items}"
					maxPageItems="10" export="currentPageNumber=pageNumber">
					<pg:param name="pageSize" value="10" />
					<pg:first>
						<a href="${pageUrl}&index=${pageNumber}&departureCity=${departureCity}&destinationCity=${destinationCity }">首页</a>
					</pg:first>
					<pg:prev>
						<a href="${pageUrl }&index=${pageNumber }&departureCity=${departureCity}&destinationCity=${destinationCity }">上一页</a>
					</pg:prev>
					<pg:pages>
						<c:choose>
							<c:when test="${pageNumber eq pi.pageNo}">
								<font color="red">${pageNumber }</font>
							</c:when>
							<c:otherwise>
								<a href="${pageUrl }&index=${pageNumber }&departureCity=${departureCity}&destinationCity=${destinationCity }">${pageNumber}</a>
							</c:otherwise>
						</c:choose>
					</pg:pages>
					<pg:next>
						<a href="${pageUrl }&index=${pageNumber }&departureCity=${departureCity}&destinationCity=${destinationCity }">下一页</a>
					</pg:next>
					<pg:last>
						<a href="${pageUrl }&index=${pageNumber }&departureCity=${departureCity}&destinationCity=${destinationCity }">尾页</a>
					</pg:last>
				</pg:pager>
			</div>
				</c:if>
			</div>
		</div>
		<br>
	</body>
</html>
